<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		<style type="text/css">
			#box{
				width: 400px;
				height: 450px;
				border: 1px solid red;
				margin-top: 20px;
			}
		</style>
		<script type="text/javascript">
			window.onload = function(){
				var btn = document.getElementById("btn");
				var box = document.getElementById("box");
				btn.onclick  = function(){
					//1.创建一个空元素节点
					var newFile = document.createElement('input');
					//2.设置属性节点
					newFile.setAttribute('type','file');
					//3.追加
					box.appendChild(newFile);
				}
			}
		</script>
	</head>
	<body>
		<!--multiple是h5中的属性 可以选择多文件-->
		<!--<input type="file" multiple="multiple"/>-->
		
		<button id="btn">新增文件域</button>
		<div id="box">
			<input type="file"/>
		</div>
	</body>
</html>
